<template>
  <div class="dashboard-page">
    <!-- 面包屑 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>面经平台</el-breadcrumb-item>
      <el-breadcrumb-item>数据看板</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- card -->
    <el-row :gutter="12">
      <el-col :span="6">
        <!-- 1 -->
        <el-card shadow="never" style="height: 140px">
          <i class="el-icon-user"></i>
          <h5 class="tit">活跃用户</h5>
          <h2 class="num">802</h2>
          <p class="tag"><i style="color: green">↑ 5.23%</i>最近一个月</p>
        </el-card>
        <!-- 2 -->
        <el-card shadow="never" style="height: 140px">
          <i class="el-icon-tickets"></i>
          <h5 class="tit">平均访问量</h5>
          <h2 class="num">1298</h2>
          <p class="tag"><i class="red">↓ 8.56%</i>截止最近一周</p>
        </el-card>
        <!-- 3 -->
        <el-card class="row" shadow="never" style="height: 180px">
          <h4>Enhance your Campqaign for better outreac→</h4>
          <img src="@/assets/img.svg" alt="" />
        </el-card>
      </el-col>
      <!-- 上右 -->
      <el-col :span="18">
        <el-card shadow="never" style="height: 504px">
          <div style="height: 500px" class="chart-box" ref="box"></div>
        </el-card>
      </el-col>

      <!-- 下三图 -->
      <el-col :span="8">
        <el-card style="height: 420px">
          <h4>性别分布情况</h4>
          <img src="@/assets/chart-03.png" alt="" />
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card style="height: 420px">
          <h4>浏览访问情况</h4>
          <img src="@/assets/chart-01.svg" alt="" />
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card style="height: 420px">
          <h4>设备系统访问情况</h4>
          <img src="@/assets/chart-02.svg" alt="" />
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'dashboard-page',
  data() {
    return {}
  },
  mounted() {
    const myChart = echarts.init(this.$refs.box)
    // 绘制图表
    myChart.setOption({
      title: {
        text: 'ECharts 入门示例'
      },
      tooltip: {},
      xAxis: {
        data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
      },
      yAxis: {},
      series: [
        {
          name: '销量',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        }
      ]
    })
  },
  methods: {}
}
</script>

<style scoped lang="scss">
.dashboard-page {
  .el-breadcrumb {
    margin-top: 10px;
    margin: bottom 25px;
  }
  .el-card {
    margin-bottom: 20px;
    position: relative;
    &.row {
      h4 {
        width: 40%;
        font-size: 18px;
        margin-left: 10%;
        float: left;
      }
      img {
        width: 40%;
        float: left;
        margin-left: 10%;
        margin-top: 30px;
      }
    }
    [class^='el-icon'] {
      font-size: 30px;
      color: #ccc;
      position: absolute;
      top: 20px;
      right: 25px;
      font-weight: bold;
    }
    .tit {
      color: #6c757d;
      font-size: 14px;
      margin: 6px 0;
    }
    .num {
      color: #6c757d;
      font-size: 30px;
      margin: 6px 0;
    }
    .tag {
      color: #999;
      margin: 0;
      font-size: 14px;
      > i {
        font-style: normal;
        margin-right: 10px;
        &.red {
          color: red;
        }
      }
    }
    img {
      width: 100%;
      height: 100%;
    }
    h4 {
      padding-bottom: 20px;
      margin: 0;
      color: #6c757d;
    }
  }
}
</style>
